package com.jcl.myutils.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

@Component
public class Component1 {

    @Autowired
    private ApplicationEventPublisher applicationEventPublisher;

    /**
     * 事件发布方法
     */
    public void pushListener() {
        applicationEventPublisher.publishEvent(new UserRegisterEvent(this));
    }
}
